<!DOCTYPE html>
<html lang="en"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<div th:replace="common/header::header('考号生成')"></div>
<script>
    function getExam(){
        $.ajax({
            type : "post",
            url : "/erems/exam/examList",    //url根据自己的项目实际定义
            async : false,
            dataType : "text",
            error : function() {
                alert("系统忙，请稍后再试！");
                return false;
            },
            success : function(text) {
                var expressExam= $("#examId");
                var str = '<option value="">全部</option>';
                var data = eval("("+text+")");
                expressExam.empty();
                for(var o in data) {
                    str += '<option value="'+data[o].id+'">'+data[o].name+'</option>';
                }
                expressExam.append(str);
            }
        });
    }
</script>
<body onload="getExam()">
<div id="wrapper" class="row">
    <div th:replace="common/header::nav"></div>
    <div id="page-inner">
        <div class="row">
            <div class="col-md-12">
                <form role="form" action="/erems/admin/examineeInfo" method="post">
                    <div class="form-group">
                        <label for="examId">考试</label>
                        <select id="examId" name="examId">
                            <option value="">全部</option>
                        </select>
                        <input type="hidden" value="1" name="tag"/
                        >
                    </div>
                    <div class="form-group">
                        <button type="submit" class="btn btn-primary">查询</button>
                    </div>
                </form>
            </div>
        </div>
        <!-- /. ROW  -->
        <div class="row">
            <div class="col-md-12">
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover">
                        <thead>
                        <th:block th:if="${currentExam}">
                            <tr>
                                <th>当前考试</th>
                                <th colspan="2" th:text="${currentExam.name}"></th>
                                <th><a th:href="'/erems/admin/num?id='+${currentExam.id}">一键生成</a></th>
                            </tr>
                        </th:block>
                        <tr>
                            <th>序号</th>
                            <th>姓名</th>
                            <th>状态</th>
                            <th>考号</th>
                        </tr>
                        </thead>
                        <th:block th:if="${examineeList!=null&&#lists.size(examineeList)>0}">
                            <tbody id="examineeList" th:each="e,estatus:${examineeList}">
                            <tr th:object="${e}" th:if="${e.pay==1&&e.score<0}">
                                <td th:text="${estatus.count}">1</td>
                                <td th:text="*{user.name}">姓名</td>
                                <td>已付款</td>
                                <th:block th:if="*{examNum}">
                                <td th:text="*{examNum}">0</td>
                                </th:block>
                                <th:block th:unless="*{examNum}">
                                    <td>无</td>
                                </th:block>
                                </th:block>
                            </tr>
                            </tbody>
                        </th:block>
                        <th:block th:unless="${examineeList!=null&&#lists.size(examineeList)>0}">
                            <tbody id="examineeList">
                            <tr>
                                <td colspan="4">未找到相应信息！</td>
                            </tr>
                            </tbody>
                        </th:block>
                    </table>
                </div>
            </div>
        </div>
        <!-- /. ROW  -->
    </div>
    <!-- /. PAGE INNER  -->
</div>
<!-- /. WRAPPER  -->

<div th:replace="common/footer"></div>
</body>
</html>
